package com.xoms.pad.persist.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.xoms.pad.model.OrderRoomDimensionBean;
import com.xoms.pad.model.RoomBean;
import com.xoms.pad.persist.dao.RoomDao;
import com.xoms.util.StringUtil;

@Repository
public class RoomImpl extends BaseImpl implements RoomDao {

	final String NAME_SPACE = NAME_SPACE_HEADER + ".RoomMapper";

	@Override
	public List<RoomBean> selectRoom(String rid,String name,List<String> lists) {
		
		Map<String, Object> params = new HashMap<String, Object>();
		
		if (!StringUtil.isEmpty(rid)) {
			params.put("rid", rid);
		}
		if (!StringUtil.isEmpty(name)) {
			params.put("name", name);
		}
		if (lists != null && lists.size() > 0) {
			params.put("lists", lists);
		}
		
		return sqlSessionTemplate.selectList(NAME_SPACE + ".selectRoom", params);
	}

	@Override
	public List<OrderRoomDimensionBean> selectOrderRoomDimension(String roomId) {
		
		Map<String, Object> params = new HashMap<String, Object>();
		
			params.put("roomId", roomId);
		
		return sqlSessionTemplate.selectList(NAME_SPACE + ".selectOrderRoomDimension", params);
	}

}
